home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 December / CHIP Aralık 1996.iso / prog / backpack / demodata / misc / start.dxr / 00115_Load Game.ls < prev    next >
Encoding:
Text File  |  1995-08-30  |  2.3 KB  |  81 lines

  1. on LoadGame
  2.   global SNAME, UNAME, TWNS, JOBS, ACTION, J, DEST_LQDS, KAT_LQDS, RANS, WANS, DTQR, DTQW, KARM, LIVC, SEX, CASH, EXCF, PNM, YY, MM, DD, DAYS, DEPDD, AFDD, TRAVEL, GameFileName, LPDAY, ARRIVE_CASH, PHONE_M, AUKT_JOBS
  3.   if the machineType = 256 then
  4.     openXLib(the pathName & "FILEIO.DLL")
  5.     set FILE to FileIO(mnew, "?read", "bpd")
  6.   else
  7.     if the machineType <> 256 then
  8.       set FILE to FileIO(mnew, "?read", "BPdr")
  9.     end if
  10.   end if
  11.   if not objectp(FILE) then
  12.     ErrorH(FILE)
  13.     exit
  14.   end if
  15.   set S to FILE(mReadLine)
  16.   if not S contains "BackPacker Game - version 1.0" then
  17.     ErrorH(999)
  18.     exit
  19.   end if
  20.   set SNAME to FILE(mReadLine)
  21.   delete char length(SNAME) of SNAME
  22.   set UNAME to FILE(mReadLine)
  23.   delete char length(UNAME) of UNAME
  24.   set SEX to value(FILE(mReadLine))
  25.   set CASH to value(FILE(mReadLine))
  26.   set EXCF to value(FILE(mReadLine))
  27.   set ACTION to value(FILE(mReadLine))
  28.   set LIVC to value(FILE(mReadLine))
  29.   set RRFCC to value(FILE(mReadLine))
  30.   set YY to value(FILE(mReadLine))
  31.   set MM to value(FILE(mReadLine))
  32.   set DD to value(FILE(mReadLine))
  33.   set DTQR to value(FILE(mReadLine))
  34.   set DTQW to value(FILE(mReadLine))
  35.   set LQNO to value(FILE(mReadLine))
  36.   set RANS to value(FILE(mReadLine))
  37.   set WANS to value(FILE(mReadLine))
  38.   set KARM to value(FILE(mReadLine))
  39.   set DAYS to value(FILE(mReadLine))
  40.   set DEPDD to value(FILE(mReadLine))
  41.   set AFDD to value(FILE(mReadLine))
  42.   set TRAVEL to value(FILE(mReadLine))
  43.   set ARRIVE_CASH to value(FILE(mReadLine))
  44.   set PHONE_M to value(FILE(mReadLine))
  45.   set AUKT_JOBS to value(FILE(mReadLine))
  46.   set GameFileName to FILE(mFileName)
  47.   FILE(mdispose)
  48.   if the machineType = 256 then
  49.     closeXLib(the pathName & "FILEIO.DLL")
  50.   end if
  51.   if not CodeMachine(J, "Decode", RRFCC) then
  52.     ErrorH(666)
  53.     exit
  54.   end if
  55.   set LPDAY to DAYS
  56.   MakeLists()
  57.   go("GameLoaded")
  58. end
  59.  
  60. on ErrorH ErrMess
  61.   if ErrMess = -43 then
  62.     nothing()
  63.   else
  64.     if ErrMess = -49 then
  65.       alert("Kan inte ers├ñtta gamla filer!")
  66.     else
  67.       if ErrMess < 0 then
  68.         alert("Problem med l├ñsning av filen!")
  69.       else
  70.         if ErrMess = 666 then
  71.           alert("Detta BackPackerdokument ├ñr korrupt och kan ej anv├ñndas!")
  72.         else
  73.           if ErrMess = 999 then
  74.             alert("Detta ├ñr inte ett kompatibelt BackPackerdokument!")
  75.           end if
  76.         end if
  77.       end if
  78.     end if
  79.   end if
  80. end
  81.